export default defineEventHandler(async (event) => {
  const body = await readBody(event)
  
  // 模拟创建订单
  const orderId = `ord_${Date.now()}`
  const orderNo = `ORD${new Date().getFullYear()}${(new Date().getMonth() + 1).toString().padStart(2, '0')}${new Date().getDate().toString().padStart(2, '0')}${Math.floor(Math.random() * 10000).toString().padStart(4, '0')}`
  
  console.log('创建订单:', {
    items: body.items,
    paymentMethod: body.paymentMethod,
  })
  
  return {
    code: 200,
    message: '订单创建成功',
    data: {
      orderId,
      orderNo,
    },
  }
})

